/*
 * TrajectoryTests.h
 *
 */
#ifndef _TRAJECTORY_TESTS_H_
#define _TRAJECTORY_TESTS_H_

#include <cppunit/TestCase.h>
#include <cppunit/TestSuite.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/TestAssert.h>

#include "Vector.h"
#include "Trajectory.h"

class TrajectoryTests : public CppUnit::TestFixture
{
	CPPUNIT_TEST_SUITE(TrajectoryTests);
	CPPUNIT_TEST(testPosition);
	CPPUNIT_TEST_SUITE_END();

public:

	void setUp() { }

	void tearDown() { }

	void testPosition() {
		Vector b;
		Vector a(1.0, 1.0, -1.0);
		Trajectory trajectory(a, b);
		const double DELTA(0.05);

		for (double t = 0; t < 1.0; t += DELTA)
		{
			Vector expected(a * t + b);
			Vector actual = trajectory.position(t);

			CPPUNIT_ASSERT_EQUAL(expected, actual);
		}
	}
};

#endif /* _TRAJECTORY_TESTS_H_ */
